package gavdi.dk.view;


import gavdi.dk.controller.EventAdapter;
import gavdi.dk.data.DAOCustomer;
import gavdi.dk.data.DAOEvent;

import gavdi.dk.model.User;

import gavdi.dk.view.R;


import android.os.Bundle;



import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ScrollView;


import android.app.Activity;


public class EventActivity extends Activity { 

	private Bundle bundle;
	private LinearLayout ll;
	private User user;
	private ListView listView1;
	private String userID;
	private DAOEvent dEvent;
	private ScrollView sView;
	private DAOCustomer dCust;
	
 


    
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.event_layout);

		initAttributes();
		
    		 EventAdapter adapter = new EventAdapter(this,
    		 R.layout.item_row,  dEvent.getAllEventsByUserID(userID));
    		 
    		 

		 
		 listView1 = (ListView)findViewById(R.id.listView1);
		

		// View header = (View)getLayoutInflater().inflate(R.layout.header_row,
		// null);
	//	 listView1.addHeaderView(header);

		 listView1.setAdapter(adapter);
		



	}
	
	

	
	private void initAttributes() {

		bundle = getIntent().getExtras();
		userID = bundle.getString("userID");
		// user = (User) bundle.getSerializable("user");
		ll = (LinearLayout) findViewById(R.id.scroll);
		dEvent = new DAOEvent(getBaseContext());
	}





	
}


